import { Image } from 'antd-mobile';
import { UpOutline } from 'antd-mobile-icons';
import { IOrganization } from '@/utils/type';
import style from './index.module.less';
import { useScrollToTopButton } from '../../../../hooks/useScrollToTopButton';

interface IProps {
  data: IOrganization;
  front: [{ url: string }];
}

const DescInfo = ({ data, front }: IProps) => {
  const { isVisible, scrollToTop } = useScrollToTopButton({ threshold: 100 });
  return (
    <div className={style.container}>
      {data.description}
      <div
        onClick={scrollToTop}
        style={isVisible ? { right: '10px' } : { right: '-80px' }}
        className={style.backTop}
      >
        <UpOutline />
      </div>
      <div className={style.otherImg}>
        {front.map((item:any, index:any) => (
          <Image src={item.url} alt="其他图片" key={index} />
        ))}
      </div>
    </div>
  );
};

export default DescInfo;
